package com.tencent.sr.iris.activity.restapi.activity;

import com.tencent.sr.iris.activity.interfaces.client.activity.ActivityTaskClient;
import com.tencent.sr.iris.activity.interfaces.request.acticity.ActivityAndTaskRequest;
import com.tencent.sr.iris.activity.interfaces.response.activity.ActivityAndTaskResponse;
import com.tencent.sr.iris.activity.service.activity.IrisActivityService;
import com.tencent.sr.rmall.common.primitive.HttpResult;
import com.tencent.sr.rmall.common.request.PaginationRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "活动与任务", value = "活动与任务相关接口")
@RestController
@RequestMapping(value = {"/api/v1/iris/iris-activity-core-service/activity/task"})
public class ActivityTaskController implements ActivityTaskClient {

    @Resource
    public IrisActivityService irisActivityService;

    @Override
    @PostMapping("getActivityAndTask")
    @ApiOperation(value = "查询任务和子任务", httpMethod = "POST")
    public HttpResult<ActivityAndTaskResponse> getActivityAndTask(
            @Validated @RequestBody ActivityAndTaskRequest request) {
        return HttpResult.succ(irisActivityService.getActivityAndTask(request));
    }
}
